package day02;

import java.util.Arrays;
import java.util.Comparator;

/**
 * Created by Administrator on 2023/6/30 0030.
 */
public class ArraysBinarySearch {
    public static void main(String[] args) {
        Integer[] a = new Integer[]{12, 7, 2, 1, 0};
        int k = 7;
        int p = Arrays.binarySearch(a, k, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2 - o1;
            }
        });
        System.out.println(p);
    }
}
